import Vue from 'vue'
import Vuex from 'vuex'
import axios from 'axios'
import createPersistedState from 'vuex-persistedstate'
Vue.use(Vuex)
export default new Vuex.Store({
    state:{
       token:''
    },
    mutations:{
        // 修改
        set_token (state, token) {
            state.token = token
            sessionStorage.token = token
        },
        //删除
        del_token (state) {
            state.token = ''
            sessionStorage.removeItem('token')
        }
    },
    actions:{

    },
    modules: {
    
    },
    plugins: [createPersistedState()]
})